﻿using TianShu.SysParameterSetting.DAL.Abstracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShu;

namespace Test.Service.Abstracts
{
    public class WmsMaterialImportOutput
    {
        public WmsMaterialImportOutput()
        {

        }
        public WmsMaterialImportOutput(WmsMaterialImportInput input,string msg)
        {
            if (msg.IsNullOrEmpty())
            {
                msg = "导入成功";
            }
            this.Type = input.Type;
            if (input.ValidityValueType.HasValue)
            {
                this.ValidityValueType = EnumExtends.GetDisplayName(input.ValidityValueType.Value);
            }
            if (input.WarningLeadValue.HasValue)
            {
                this.WarningLeadValueType = EnumExtends.GetDisplayName(input.WarningLeadValueType);
            }
            this.Attribute = input.Attribute;
            this.Code = input.Code;
            this.Description = input.Description;
            this.IsFirstInFirstOut = input.IsFirstInFirstOut;
            this.Name = input.Name;
            this.SecurityInventoryNumber = input.SecurityInventoryNumber;
            this.SpecificationModel = input.SpecificationModel;
            this.Type = input.Type;
            this.Unit = input.Unit;
            this.UnitPrecision = input.UnitPrecision;
            this.ValidityValue = input.ValidityValue;
            this.WarningLeadValue = input.WarningLeadValue;
            this.Msg = msg;
        }

        ///<summary>
        ///<para>物料属性值：【1：自制、2：采购、4：销售、8：投产】，多个则将值相加，例如采购+投产=10</para>
        ///</summary>
        public string Attribute { get; set; }

        ///<summary>
        ///<para>编码</para>
        ///</summary>
        public string Code { get; set; }

        ///<summary>
        ///<para>描述</para>
        ///</summary>
        public string Description { get; set; }

        ///<summary>
        ///<para>是否先进选出</para>
        ///</summary>
        public bool IsFirstInFirstOut { get; set; }

        ///<summary>
        ///<para>物料类别id</para>
        ///</summary>
        public string Type { get; set; }

        ///<summary>
        ///<para>名称</para>
        ///</summary>
        public string Name { get; set; }

        ///<summary>
        ///<para>安全库存数</para>
        ///</summary>
        public long SecurityInventoryNumber { get; set; }

        ///<summary>
        ///<para>规格型号</para>
        ///</summary>
        public string SpecificationModel { get; set; }

        ///<summary>
        ///<para>主单位id</para>
        ///</summary>
        public string Unit { get; set; }

        ///<summary>
        ///<para>单位精度</para>
        ///</summary>
        public int UnitPrecision { get; set; }

        ///<summary>
        ///<para>有效期值</para>
        ///</summary>
        public int? ValidityValue { get; set; }

        ///<summary>
        ///<para>有效期值类型（1：秒，2：分钟，4：小时，8：天，16：月，32：年）</para>
        ///</summary>
        public string ValidityValueType { get; set; }

        ///<summary>
        ///<para>有效期预警提前值</para>
        ///</summary>
        public int? WarningLeadValue { get; set; }

        ///<summary>
        ///<para>效期预警提前值类型（1：秒，2：分钟，4：小时，8：天，16：月，32：年）</para>
        ///</summary>
        public string WarningLeadValueType { get; set; }

        ///<summary>
        ///<para>消息</para>
        ///</summary>
        public string Msg { get; set; }
    }
}
